GoXam for WPF v3
Attribute<T>(XName,T,T,Func<T,String>) Method
Northwoods.GoXam.Model Namespace > XHelper Class > Attribute Method : Attribute<T>(XName,T,T,Func<T,String>) Method
the value type
the name of the XAttribute
the value
the default value for this attribute/property
a function from T to String
This generic method produces an XAttribute with the given value if the value is not equal to the given default value, using the given conversion function to convert the value to a string.
Syntax
public static XAttribute Attribute<T>( 
   XName n,
   T v,
   T defval,
   Func<T,string> conv
)

Parameters

n
the name of the XAttribute
v
the value
defval
the default value for this attribute/property
conv
a function from T to String

Type Parameters

T
the value type

Return Value

an XAttribute, or null if the value is null or if it is equal to the default value
See Also

Reference

XHelper Class
XHelper Members
Overload List